package demo_9_9_2;

public class Complex {

		public int real;
		public int imagn;
		
		public Complex() {
			this.real = 0;
			this.imagn = 0;
		}
		

		public Complex(int real, int imagn) {
			this.real = real;
			this.imagn = imagn;
		}
		public void increase() {
			this.real=real+1;
		}
		public void print() {
			if(this.real==00&&this.imagn==0)
				System.out.println("0");
			else if(this.imagn<0&&this.real>0)
				System.out.println(real+""+imagn+"i");
			else if(this.real==0&&this.imagn>0)
				System.out.println(imagn+"i");
			else if(this.imagn==0)
				System.out.println(real);
			else
				System.out.println(real+"+"+imagn+"i");
		}

		public static void main(String[] args) {
			Complex c1=new Complex();
			Complex c2=new Complex(1,2);
			Complex c3=new Complex(2,-3);
			Complex c4=new Complex(-3,4);
			Complex c5=new Complex(0,5);
			Complex c6=new Complex(6,0);
			c6.increase();
			c1.print();
			c2.print();
			c3.print();
			c4.print();
			c5.print();
			c6.print();

		}

	
}
